import { defineStore } from "pinia";
import { ref } from "vue";

const useToken = defineStore('token',() => {
    const token = ref(null)
    const updateToken = (value) => token.value = value
    const removeToken = () => token.value = null;
    return{token,updateToken,removeToken}
},
    {
        persist: {
            key:'token',
            storage:localStorage
        }
    }
)

export default useToken;